// 题意：找所有树的中心（重心）
//
// 题解：我是用树上dp，差不多两遍dfs，第一遍求出每个子树大小，第二遍求
//       当前点相连的所有子树大小的最大值。最后中心点就是大小最小的那些。
//
//       http://blog.csdn.net/fjsd155/article/details/6917291
//
//       膜拜神犇的blog
//       http://fanhq666.blog.163.com/blog/static/81943426201172472943638/
//
#include <iostream>
#include <algorithm>
#include <vector>

typedef std::vector<int> edge_type;
typedef std::vector<edge_type> graph_type;
graph_type graph;
typedef edge_type::iterator edge_iter;

std::vector<int> tree_size;
std::vector<int> max_subtree;
std::vector<bool> visited;
int n, centroid_size;

int dfs_count_size(int u)
{
	visited[u] = true;
	int sum = 1;
	for (edge_iter it = graph[u].begin(); it != graph[u].end(); ++it) {
		int v = *it;
		if (visited[v]) continue;
		sum += dfs_count_size(v);
	}
	return tree_size[u] = sum;
}

void dfs_count_max_subtree(int u)
{
	visited[u] = true;
	int max_sub = n - tree_size[u];
	for (edge_iter it = graph[u].begin(); it != graph[u].end(); ++it) {
		int v = *it;
		if (visited[v]) continue;
		max_sub = std::max(max_sub, tree_size[v]);
		dfs_count_max_subtree(v);
	}
	max_subtree[u] = max_sub;
	centroid_size = std::min(centroid_size, max_sub);
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n;
	graph.resize(n);
	tree_size.resize(n);
	max_subtree.resize(n);
	visited.resize(n);
	for (int i = 1, x, y; i < n; i++) {
		std::cin >> x >> y;
		x--; y--;
		graph[x].push_back(y);
		graph[y].push_back(x);
	}

	dfs_count_size(0);

	centroid_size = n;
	std::fill(visited.begin(), visited.end(), false);
	dfs_count_max_subtree(0);

	std::cout << centroid_size;
	std::vector<int> centroid_node;
	for (int i = 0; i < n; i++)
		if (max_subtree[i] == centroid_size)
			centroid_node.push_back(i+1);
	std::cout << ' ' << centroid_node.size() << '\n';

	std::cout << centroid_node[0];
	for (int i = 1; i < (int)centroid_node.size(); i++)
		std::cout << ' ' << centroid_node[i];
	std::cout << '\n';
}

